<?php
class resource_advertise_row extends system_concept_row {
	
	protected $_resource = null;
	/**
	 * @return resource_display
	 */
	public function getResource() {
		if($this->_resource === null || $this->_resource->getHash() != $this->get('hash')) {
			$this->_resource = new resource_display($this->get('hash'), 'advertise');
		}
		return $this->_resource;
	}
	
	public function setName($name) {
		if(!$name) {
			$this->set('name', '');
		} else {
			$name = preg_replace('#[\\\\\\\/\?\|\#]+#u', '-', $name);
			$this->set('name', $name);
		}
		return $this;
	}
	
	protected $_langList = array();
	public function addLangList($key, $lang) {
		$this->_langList[$key] = $lang;
	}
	
	public function getLangList() {
		return $this->_langList;
	}
	
	protected $_deviceList = array();
	public function addDeviceList($device) {
		$this->_deviceList[$device] = $device;
	}
	
	public function getDeviceList() {
		return $this->_deviceList;
	}
			
}
